<?php echo $this->Session->flash(); ?>
<div id="loading" style="display: none;">
    <?php echo $html->image('loading.gif', array('border' => "0", 'align' => 'center')); ?>
</div>
<h1>DESEMBOLSO PAGO DEL PREDIO</h1>
<table id="tabla">
    <thead>
        <tr>
            <th>Id</th>
            <th>Valor</th>
            <th>Calificación Total</th>
            <th>Observación Total</th>
            <th colspan ="3">Acciones</th>
        </tr>
    </thead>
    <tbody>     
        <?php $editar = true ?>
        <?php foreach ($ExpenseProperties as $ExpenseProperty): ?>
            <tr>
                <td><?php echo $ExpenseProperty['ExpenseProperty']['id'] ?></td>
                <td><?php echo '$ ' . number_format($ExpenseProperty['ExpenseProperty']['valor'], 2, ',', '.') ?></td>
                <td><?php echo $ExpenseProperty['ExpenseProperty']['calificacion_total'] ?></td>
                <td><?php echo substr($ExpenseProperty['ExpenseProperty']['observacion_total'], 0, 200) . "..." ?></td>
                <td><?php
        if ($editar)
            echo $ajax->link('Editar', array('controller' => 'ExpenseProperties', 'action' => 'edit', $ExpenseProperty['ExpenseProperty']['id']), array('class' => 'actions', 'update' => 'content', 'indicator' => 'loading', 'escape' => false));
        echo "<br>";
        echo "<br>";
        $editar = false;
        echo $ajax->link('Calificar', array('controller' => 'ExpenseProperties', 'action' => 'qualify', $ExpenseProperty['ExpenseProperty']['id']), array('class' => 'actions', 'update' => 'content', 'indicator' => 'loading', 'escape' => false));
        echo "<br>";
        echo "<br>";
        echo $ajax->link('Ver_observaciones', array('controller' => 'ExpenseProperties', 'action' => 'qualify_view', $ExpenseProperty['ExpenseProperty']['id']), array('class' => 'actions', 'update' => 'content', 'indicator' => 'loading', 'escape' => false));
            ?>
                    <br>
                    <br>
                    <?php echo $this->Html->link('Certificación', array('action' => 'print_certification', $ExpenseProperty['ExpenseProperty']['id'], 'controller' => 'ExpenseProperties'), array('target' => '_blank', 'class' => 'actions')) ?> 

                </td>
                <td><?php echo $ajax->link("Cuentas bancarias", array('controller' => 'BankAccounts', 'action' => 'indexProperties', $ExpenseProperty['ExpenseProperty']['id']), array('class' => 'actions', 'update' => 'content', 'complete' => 'cargar()', 'indicator' => 'loading')); ?></td>
            </tr>
        <?php endforeach; ?>
    </tbody>
</table>

<br><?php
        if (empty($ExpenseProperties))
            echo $ajax->link('Adicionar ', array('Controller' => 'ExpenseProperties', 'action' => 'add', $proyect_id), array('class' => 'actions', 'update' => 'content', 'indicator' => 'loading', 'escape' => false), "¿Desea agregar un nuevo desembolso de predio?, Una vez agregado aparecerá en la lista, desde allí podrá modificarlo.");
        ?>
<br><br><br>